"""
__project__ = 'thc'
__file_name__ = 'get,post,patch,delece'
__author__ = 'thc'
__time__ = '2021/1/14/014 14:23'
__product_name = PyCharm
-*- coding:utf-8 -*-
"""

import requests

base_url = 'https://www.baidu.com/'
base_url1 = 'http://httpbin.org/'
#
#
# # get请求
# print('get请求————————————————————————————')
# param = {'id': '001', 'user': 'tom'}
# r = requests.get(base_url + '/get', params=param)
# print(r.status_code)
# print(r.text)
#
# # post请求
# print('post请求————————————————————————————')
# form_data = {'id': '001', 'user': 'tom'}
# r = requests.post(base_url + '/post', data=form_data)
# print(r.status_code)
# print(r.text)
#
# # patch请求
# print('patch请求————————————————————————————')
# r = requests.patch(base_url + '/patch')
# print(r.status_code)
#
# # delete请求
# print('patch请求————————————————————————————')
# r = requests.delete(base_url + '/delete')
# print(r.status_code)

r = requests.get(base_url)
print(r.cookies)
my_dict = dict()
for key,value in r.cookies.items():
    my_dict[key] = value
    print(my_dict)




# cookie = {'BDORZ': '27315'}
# r = requests.get(base_url1 + 'cookies', cookies=cookie, timeout=0.01)
# print(r.status_code)
